Skip to content

Prefs: one policy note, a read-only Services card, and UAC at save time instead of Unlock - #66

Merged
rodchristiansen merged 3 commits into
mainfrom
feature/prefs-banner-services
Oct 13, 2026
Merged

rodchristiansen merged 3 commits into
mainfrom
feature/prefs-banner-services

Conversation

@rodchristiansen

@rodchristiansen rodchristiansen commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #65

Policy note and Services card

  • Removes the twelve per-field "Managed by Policy" captions; policy-set fields stay disabled in the default gray.
  • Adds one secondary-text line under the header, "Settings shown in gray have been configured by a policy.", visible only when a value comes from the policy key (HasPolicySettings).
  • Adds a full-width read-only Services card. The installer (installer/Product.wxs) registers one scheduled task, BootstrapMate Self-Heal, and no services. The card shows its state, last run result and schedule in plain words, read through the Task Scheduler COM API off the UI thread; access denied shows "Unknown", a missing task shows "Not installed".
  • Formatting and querying live in BootstrapMate.Core/InstallFootprint.cs, with unit tests for start type, task state, result code and trigger XML wording.
  • Prefs cards sit on an even two-column grid (MaxWidth 1040, shared CardStyle): Connection | Behavior, Dialog | Advanced, Services across both.

No Unlock mode

  • Removes the Unlock banner, the whole-app elevated relaunch and the --prefs switch. Editability depends on policy alone (PrefsPolicy.CanEdit).
  • Edits are held pending; Save and Discard appear only when there are unsaved changes. Save writes directly when the app is already elevated; otherwise it runs the app's own exe with runas and --apply-settings <pipe>, then sends the values as JSON over a one-instance named pipe with a random name whose ACL admits only the current user, Administrators and SYSTEM (so over-the-shoulder admin elevation works). Nothing touches disk. Both sides time out after 60 s.
  • Program.cs now owns Main (DISABLE_XAML_GENERATED_MAIN) so that writer runs headless and exits 0/non-zero before any window exists. It re-reads policy, skips every managed key, and validates the timeout range.
  • Declined UAC: "Not saved: administrator approval was declined." and the edits stay pending. Other failures: "Not saved: ". Success reloads from the registry and shows "Saved".
  • Tests cover managed vs unmanaged editability, the elevated start info, a round-trip over the real ACL'd pipe, managed-key skipping and validation (PrefsSettingsWriterTests).

Risk: medium

Drop the per-field "Managed by Policy" captions: fields set by policy stay
disabled and gray, and a single line at the top of the tab says so when any
value comes from the policy key.

Add a Services card listing what the installer registers (the daily
self-heal scheduled task) with its state, last result and schedule in plain
words, queried through the Task Scheduler without elevation. Lay the Prefs
cards out on an even two-column grid with Services spanning both columns.
…time

Every setting policy does not manage is editable in the normal app. Edits
stay pending behind Save and Discard; Save writes directly when elevated,
otherwise it raises UAC and runs the app's own executable headless with
--apply-settings and a temp JSON file. That writer re-reads policy, skips
every managed key, validates the values and exits without a window. A
declined prompt keeps the edits pending and says so.

Removes the Unlock banner, the whole-app elevated relaunch and the --prefs
switch it used.
@rodchristiansen rodchristiansen changed the title Show one policy note and a read-only Services card on the Prefs tab Prefs: one policy note, a read-only Services card, and UAC at save time instead of Unlock Oct 13, 2026
The values can include a credential header, so they no longer go through
a temp file. The GUI creates a one-instance pipe with a random name that
only the current user, Administrators and SYSTEM can open, passes the name
to the elevated --apply-settings process and writes the JSON when it
connects. Both sides time out after 60 seconds, which covers the UAC
prompt, and a declined prompt still leaves the edits pending.
@rodchristiansen
rodchristiansen merged commit 474374d into main Oct 13, 2026
2 checks passed
@rodchristiansen
rodchristiansen deleted the feature/prefs-banner-services branch October 13, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefs tab: one policy note, a Services card, and no Unlock mode

1 participant